<?php
$this->LoadHelper('MemberHelper');
$MemberHelper = new MemberHelper();

$this->LoadHelper('SettingHelper');
$SettingHelper = new SettingHelper();

$ajax = $this->Param['ajax'];
$page = isset($this->Param['page']) ? $this->Param['page'] : 1;
$rp = isset($this->Param['rp']) ? $this->Param['rp'] : PAGE_SIZE;
if ($ajax) {
    $where = array(
        '`au_status` = ?' => 'ok'
    );
    $data = $SettingHelper->auditList($where, $page, $rp, $this->Param);
    $json_data = array('total' => $data['count'], 'rows' => array());
    foreach ($data['all'] AS $rowNum => $row) {
        $row['op'] = '<a href="javascript:;" class="J-department" data-id="'.$row['dp_id'].'">管理用户</a>';
        $json_data['rows'][] = $row;
    }
    echo json_encode($json_data);
} else {
    $member_info = $MemberHelper->getMember($this->UserConfig['Id']);
    $this->Assign('member_info', $member_info);
    echo $this->GetView('audit_index.php');
}